/*
 * Copyright 2008 Sanjiv Sahayam
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.googlecode.pinthura.factory.instantiator;

import com.googlecode.pinthura.factory.MethodParam;
import com.googlecode.pinthura.factory.InjectedFactory;
import com.googlecode.pinthura.factory.Factory;

/**
 * Extracts factory information from a supplied <code>MethodParam</code> object.
 */
public interface AnnotatedFactoryExtractor {

    /**
     * Extracts a <code>InjectedFactory</code> from a <code>MethodParam</code>
     * @param methodParam The method.
     * @return The InjectedFactory on the method.
     * Exceptions are propagated from underlying classes.
     */
    InjectedFactory extract(final MethodParam methodParam);

    /**
     * Extracts a <code>Factory[]</code> from a <code>MethodParam</code>
     * @param methodParam The method.
     * @return The Factory[] on the method.
     * Exceptions are propagated from underlying classes.
     */
    Factory[] extractFactories(final MethodParam methodParam);
}
